/**
 * Copyright (c) 2018-2025, NXOS Development Team
 * SPDX-License-Identifier: Apache-2.0
 * 
 * Contains: sched trace event
 * 
 * Change Logs:
 * Date           Author            Notes
 * 2025-06-24     JasonHu           Init
 */

#ifndef __NXOS_TRACE_SCHED_H__
#define __NXOS_TRACE_SCHED_H__

#include <nxos_mini.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifdef CONFIG_TRACE_EVENT_SCHED

void NX_InitSchedTraceEvent(void);
void NX_ExitSchedTraceEvent(void);

NX_Error NX_TraceSchedSwitch(NX_U32 prevTid, NX_U32 nextTid, NX_U32 prevStat);
NX_Error NX_TraceSchedWakeup(NX_U32 tid, NX_U32 targetCpu);

#else

#define NX_InitSchedTraceEvent()
#define NX_ExitSchedTraceEvent()

NX_INLINE NX_Error NX_TraceSchedSwitch(NX_U32 prevTid, NX_U32 nextTid, NX_U32 prevStat)
{
    return NX_EOK;
}

NX_INLINE NX_Error NX_TraceSchedWakeup(NX_U32 tid, NX_U32 targetCpu)
{
    return NX_EOK;
}

#endif

#ifdef __cplusplus
}
#endif

#endif  /* __NXOS_TRACE_SCHED_H__ */
